package cn.com.computer.my.game.service.bo.emums;


/**
 * Created by WANGXin on 2017/5/19.
 */
public enum GameFinishEnum {
    YES("YES","通关"),
    NO("NO","未通关");

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getName(String code) {
        if (code == null) {
            return null;
        }
        for (GameFinishEnum e : GameFinishEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getDesc();
            }
        }
        return null;
    }
    public static String getValue(String desc) {
        if (desc == null) {
            return null;
        }
        for (GameFinishEnum e : GameFinishEnum.values()) {
            if (e.getDesc().equals(desc)) {
                return e.getCode();
            }
        }
        return null;
    }

    GameFinishEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
